CREATE TABLE jms_dm.dm_network_automation_rate_dt (
  `agent_code` varchar(50) NULL COMMENT '代理区编码',
  `agent_name` varchar(50) NULL COMMENT '代理区名称',
  `franchisee_code` varchar(50) NULL COMMENT '加盟商编码',
  `franchisee_name` varchar(500) NULL COMMENT '加盟商名称',
  `network_code` varchar(50) NULL COMMENT '网点编码',
  `network_name` varchar(500) NULL COMMENT '网点名称',
  `output_num` bigint(20) NULL COMMENT '出件-出件量',
  `output_auto_num` bigint(20) NULL COMMENT '出件-自动化扫描量',
  `output_pc_num` bigint(20) NULL COMMENT '出件-PC端扫描量',
  `output_smart_num` bigint(20) NULL COMMENT '出件-智能设备扫描量',
  `output_auto_sort_num` bigint(20) NULL COMMENT '出件-自动分练扫描量',
  `output_common_num` bigint(20) NULL COMMENT '出件-共配扫描量',
  `dispatch_num` bigint(20) NULL COMMENT '派件-派件量',
  `dispatch_auto_num` bigint(20) NULL COMMENT '派件-自动化扫描量',
  `dispatch_pc_num` bigint(20) NULL COMMENT '派件-PC端扫描量',
  `dispatch_smart_num` bigint(20) NULL COMMENT '派件-智能设备扫描量',
  `dispatch_auto_sort_num` bigint(20) NULL COMMENT '派件-自动分练扫描量',
  `dispatch_common_num` bigint(20) NULL COMMENT '派件-共配扫描量',
   station_type int(6) comment '网点类型 5集散 6网点',
  `scan_date` date NULL COMMENT '扫描日期'
) ENGINE=OLAP
DUPLICATE KEY(`agent_code`)
COMMENT 'OLAP'
PARTITION BY RANGE(`scan_date`)(
 START('2022-08-01') END ('2022-09-15') EVERY (INTERVAL 1 day))
DISTRIBUTED BY HASH(`network_code`) BUCKETS 3
PROPERTIES (
'replication_num' = '3',
'dynamic_partition.enable' = 'true',
'dynamic_partition.time_unit' = 'DAY',
'dynamic_partition.time_zone' = 'Asia/Shanghai',
'dynamic_partition.start' = '-365',
'dynamic_partition.end' = '3',
'dynamic_partition.prefix' = 'p',
'dynamic_partition.buckets' = '3',
'in_memory' = 'false',
'storage_format' = 'V2'
);